<?php


use Ratchet\Http\HttpServer;
use Ratchet\Server\IoServer;
use Ratchet\WebSocket\WsServer;
use app\WebSocket\WebSocketServer;
if (!defined('ROOT_PATH')) {
    define('ROOT_PATH', __DIR__); // 设置为你的项目根目录
}

// 定义 DS 常量，表示目录分隔符
if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}
require  '../thinkphp/library/think/Console.php';
require '../vendor/autoload.php'; // 引入 Composer 自动加载

$server = IoServer::factory(new HttpServer(new WsServer(new WebSocketServer())), 39001);

$server->run();